home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
auto-l1a
/
idd_main.frm
< prev
next >
Wrap
Text File
|
1999-03-30
|
8KB
|
224 lines
VERSION 5.00
Begin VB.Form IDD_Main
BorderStyle = 1 'Fixed Single
Caption = "NT AutoLogin "
ClientHeight = 3405
ClientLeft = 45
ClientTop = 615
ClientWidth = 2580
Icon = "IDD_Main.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3405
ScaleWidth = 2580
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox IDE_ReEnterPassword
Height = 285
IMEMode = 3 'DISABLE
Left = 120
PasswordChar = "*"
TabIndex = 3
Top = 1800
Width = 2295
End
Begin VB.CommandButton IDCM_Exit
Caption = "Exit"
Height = 375
Left = 1320
TabIndex = 6
Top = 2880
Width = 1095
End
Begin VB.CommandButton IDCM_Save
Caption = "Save"
Height = 375
Left = 120
TabIndex = 5
Top = 2880
Width = 1095
End
Begin VB.TextBox IDE_Username
Height = 285
Left = 120
TabIndex = 1
Top = 600
Width = 2295
End
Begin VB.TextBox IDE_Password
Height = 285
IMEMode = 3 'DISABLE
Left = 120
PasswordChar = "*"
TabIndex = 2
Top = 1200
Width = 2295
End
Begin VB.TextBox IDE_Domain
Height = 285
Left = 120
TabIndex = 4
Top = 2400
Width = 2295
End
Begin VB.CheckBox IDCK_AutoLogin
Caption = "Use AutoLogin"
Height = 375
Left = 120
TabIndex = 0
Top = 0
Width = 2055
End
Begin VB.Label IDL_ReEnterPassword
AutoSize = -1 'True
Caption = "Re-enter Password"
Height = 195
Left = 120
TabIndex = 10
Top = 1560
Width = 1350
End
Begin VB.Label IDL_Username
AutoSize = -1 'True
Caption = "User Name"
Height = 195
Left = 120
TabIndex = 9
Top = 360
Width = 795
End
Begin VB.Label IDL_Password
AutoSize = -1 'True
Caption = "Password"
Height = 195
Left = 120
TabIndex = 8
Top = 960
Width = 690
End
Begin VB.Label IDL_Domain
AutoSize = -1 'True
Caption = "Domain"
Height = 195
Left = 120
TabIndex = 7
Top = 2160
Width = 540
End
Begin VB.Menu IDM_About
Caption = "About"
End
End
Attribute VB_Name = "IDD_Main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
If OperatingSystemVersion = WindowsNT Then
IDCK_AutoLogin.Value = GetSettingSpecial("CurrentVersion", "WinLogon", "AutoAdminLogon", 0, HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT")
IDE_Username.Text = GetSettingSpecial("CurrentVersion", "WinLogon", "DefaultUserName", "", HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT")
IDE_Password.Text = GetSettingSpecial("CurrentVersion", "WinLogon", "DefaultPassword", "", HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT")
IDE_ReEnterPassword.Text = IDE_Password.Text
IDE_Domain.Text = GetSettingSpecial("CurrentVersion", "WinLogon", "DefaultDomainName", "", HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT")
Else
Call MsgBox("AutoLogin is only for Windows NT 4.0. Please download TweakUI for 95.", vbOKOnly, "Exiting AutoLogin")
Unload Me
End If
Call IDCK_AutoLogin_Click
IDCM_Save.Enabled = False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim ret As Integer
If IDCM_Save.Enabled = True Then
ret = MsgBox("Do you want to save these settings?", vbYesNo + vbQuestion, "Exit AutoLogin")
If ret = vbYes Then
Call IDCM_Save_Click
Unload Me
Else
Unload Me
End If
Else
Unload Me
End If
End Sub
Private Sub IDCK_AutoLogin_Click()
IDCM_Save.Enabled = True
If IDCK_AutoLogin.Value = vbUnchecked Then
IDL_Username.Enabled = False
IDL_Password.Enabled = False
IDL_ReEnterPassword.Enabled = False
IDL_Domain.Enabled = False
IDE_Username.Enabled = False
IDE_Password.Enabled = False
IDE_ReEnterPassword.Enabled = False
IDE_Domain.Enabled = False
Else
IDL_Username.Enabled = True
IDL_Password.Enabled = True
IDL_ReEnterPassword.Enabled = True
IDL_Domain.Enabled = True
IDE_Username.Enabled = True
IDE_Password.Enabled = True
IDE_ReEnterPassword.Enabled = True
IDE_Domain.Enabled = True
End If
End Sub
Private Sub IDCM_Exit_Click()
Unload Me
End Sub
Private Sub IDCM_Save_Click()
If IDE_Password.Text <> IDE_ReEnterPassword.Text Then
Call MsgBox("Passwords do not match", vbCritical + vbOKOnly, "Error")
IDE_Password.SetFocus
Exit Sub
End If
Call SaveSettingSpecial("CurrentVersion", "WinLogon", "AutoAdminLogon", IDCK_AutoLogin.Value, HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT")
Call SaveSettingSpecial("CurrentVersion", "WinLogon", "DefaultUserName", IDE_Username.Text, HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT")
Call SaveSettingSpecial("CurrentVersion", "WinLogon", "DefaultPassword", IDE_Password.Text, HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT")
Call SaveSettingSpecial("CurrentVersion", "WinLogon", "DefaultDomainName", IDE_Domain.Text, HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT")
IDCM_Save.Enabled = False
End Sub
Private Sub IDE_Domain_Change()
IDCM_Save.Enabled = True
End Sub
Private Sub IDE_Domain_GotFocus()
IDE_Domain.SelStart = 0
IDE_Domain.SelLength = Len(IDE_Domain.Text)
End Sub
Private Sub IDE_Password_Change()
IDCM_Save.Enabled = True
End Sub
Private Sub IDE_Password_GotFocus()
IDE_Password.SelStart = 0
IDE_Password.SelLength = Len(IDE_Password.Text)
End Sub
Private Sub IDE_ReEnterPassword_Change()
IDCM_Save.Enabled = True
End Sub
Private Sub IDE_ReEnterPassword_GotFocus()
IDE_ReEnterPassword.SelStart = 0
IDE_ReEnterPassword.SelLength = Len(IDE_ReEnterPassword.Text)
End Sub
Private Sub IDE_Username_Change()
IDCM_Save.Enabled = True
End Sub
Private Sub IDE_Username_GotFocus()
IDE_Username.SelStart = 0
IDE_Username.SelLength = Len(IDE_Username.Text)
End Sub
Private Sub IDM_About_Click()
Call MsgBox("AutoLogin Tool v" & App.Major & "." & App.Minor & "." & App.Revision & " for Windows NT 4.0 - Paul Mather - April 1999", vbOKOnly, "About")
End Sub